package com.niit.main;

import com.niit.entity.Student;
import com.niit.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * 查询所有学生信息
 *
 * @author hanliang
 */
public class Test02_SelectOne {

	public static void main(String[] args) {

		String sid = "2022204444";
		Student s = null;

		try (SqlSession session = MybatisUtil.openSession()) {
			s = session.selectOne("getOne", sid);
		}

		System.out.println("-------------------------------------------------------------------------------------------");
		System.out.println("学号\t\t姓名\t\t密码\t\t性别\t班级");
		System.out.println("-------------------------------------------------------------------------------------------");

		System.out.println(s);

	}
}
